package cn.wowjoy.pda.android_pharmacy.mvvm.vm;

import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter;

import java.util.ArrayList;
import java.util.List;

import cn.bingoogolapple.androidcommon.adapter.BGABindingRecyclerViewAdapter;
import cn.wowjoy.pda.android_pharmacy.R;
import cn.wowjoy.pda.android_pharmacy.common.core.BaseViewModel;
import cn.wowjoy.pda.android_pharmacy.databinding.ItemRvChoosePharmacyBinding;
import cn.wowjoy.pda.android_pharmacy.model.PharmacyInfo;

/**
 * Created by sinyo on 2017/7/20.
 */

public class InHospitalTaskViewModel extends BaseViewModel {


    public BGABindingRecyclerViewAdapter<PharmacyInfo, ItemRvChoosePharmacyBinding> innerAdapter = new BGABindingRecyclerViewAdapter<>(R.layout.item_rv_choose_pharmacy);
    public LRecyclerViewAdapter adapter = new LRecyclerViewAdapter(innerAdapter);

//    public BGABindingRecyclerViewAdapter<WorkInfo, ItemWorkLandBinding> linnerAdapter = new BGABindingRecyclerViewAdapter<>(R.layout.item_work_land);
//    public LRecyclerViewAdapter ladapter = new LRecyclerViewAdapter(linnerAdapter);

    private List<PharmacyInfo> datas;

    public void setData(List<PharmacyInfo> data) {
        if (null == datas)
            datas = new ArrayList<>();
        datas.clear();
        datas.addAll(data);

        innerAdapter.setData(datas);
        adapter.notifyDataSetChanged();
    }

}
